<#assign selectedUserNameField = JiveGlobals.getJiveProperty("plugin.waw.journal.username")?default('0')/>
<#assign selectedPasswordField = JiveGlobals.getJiveProperty("plugin.waw.journal.password")?default('0')/>
<#assign selectedAutoLoginField = JiveGlobals.getJiveProperty("plugin.waw.journal.autologin")?default('0')/>

<#function isDisplayedField fieldID>
	<#list selectedInfoFields?split(",") as displayed>
		<#if fieldID == displayed?trim><#return true></#if>
	</#list>
	<#return false>
</#function>
<html>
    <head>   	
        
        <title>Fitness Journal Administration</title>        
    </head>
  <body>
 
   <h1 style="float:left">Fitness Journal Administration</h1>                

	<br clear="all" />

<!-- BEGIN content box -->
<div class="jive-body-contentBox">
<p>
The following users need to have Fitness Journal account set for them.  
Click <a href="http://login.fitnessjournal.org" target="fitnessJournal">here</a> to launch a Fitness Journal window.
<ul>
<#list usersNeedingAccounts as user>
<li><a href="editUserProfile!input.jspa?user=${user.ID}">${user.name}</a></li>
</#list>
</ul>                  
<p>
Use the form below to indicate the profile field to use for the user's Fitness Journal username,
password, and auto login setting.
</p>
	<form action="admin-journal.jspa"  method="post" name="setFields">
	
	<div class="jive-table">
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
			<thead>
			    <tr>
			        <th>&nbsp;</th>
			        <th>&nbsp;</th>
			    </tr>
			</thead>
			<tbody>
			    <tr>
			        <td>Fitness Journal User Name Field:</td>
			        <td align="left">
			          <select name="userNameField">
			          <option value='0'>Select a field....</option>
				        <#list textProfileFields as field>
				        	<option value='${field.ID?c}' <#if field.ID?c == selectedUserNameField> selected='true'</#if>>${field.name}</option>
				        </#list>
					  </select>          
			        </td>
			    </tr>
			    <tr>
			        <td>Fitness Journal Password Field:</td>
			        <td align="left">
			          <select name="passwordField">
			          <option value='0'>Select a field....</option>
				        <#list textProfileFields as field>
				        	<option value='${field.ID?c}' <#if field.ID?c == selectedPasswordField> selected='true'</#if>>${field.name}</option>
				        </#list>
					  </select>          
			        </td>
			    </tr>
			        <tr>
			        <td>Fitness Journal AutoLogin Field:</td>
			        <td align="left">
			          <select name="autoLoginField">
			          <option value='0'>Select a field....</option>
				        <#list booleanProfileFields as field>
				        	<option value='${field.ID?c}' <#if field.ID?c == selectedAutoLoginField > selected='true'</#if>>${field.name}</option>
				        </#list>
					  </select>          
			        </td>
			    </tr>
			</tbody>
			<tfoot>
			    <tr>
			        <td colspan="2">
			            <input type="submit" name="set" value="Set fields">
			        </td>
			    </tr>
			</tfoot>
		</table>
	</div>
	</form> 
    </div>
	<!-- END body area -->  

  
  </body>
</html>